﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CML.EXE
{
	public class Arguments
	{
		public string source;
		public string target;
		public string script;

		public void Parse(string[] args)
		{
			foreach (var a in args)
			{
				var parts = a.Split('=');
				if (parts.Length == 1)
				{
					script = a;
					return;
				}
				var value = parts[1];
				switch (parts[0].ToLower())
				{
					case "source":
						source = value;
						break;
					case "target":
						target = value;
						break;
					case "script":
						script = value;
						break;
				}
			}
		}

		public Arguments(string[] args)
		{
			Parse(args);
		}
	}
}
